<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <title>Image uploader example -- double underscore</title>
  <link rel="stylesheet" type="text/css" href="http://double-underscore.googlecode.com/svn/trunk/src/imguploader/imguploader.css" />
  <link rel="stylesheet" type="text/css" href="../example.css" />
<style>
#container {
  background : #EEF6FC;
  border-top : 1px solid #DBEBF1;
  padding : 10px;
}
</style>
</head>
<body>
<div id="doc4">
  <div class="hd">
    <div class="logo" style="float:left;"><a href="http://code.google.com/p/double-underscore/" target="_blank"><img src="http://stauren.net/misc/images/bullhead.gif" /></a></div>
    <div class="hd-title">Du Image Uploader example</div>
    <div>
      <a href="http://code.google.com/p/double-underscore/">Project home</a>&nbsp;
      <a href="http://code.google.com/p/double-underscore/w/list">More docs </a>
    </div>
  </div>
  <div class="hd">
    <form>
    <div id="container">
    </div>
    </form>
  </div>
    <h1>code:</h1>
单独的ImgCropper的例子请参见： <a href="../imgcropper/demo.html" target="_blank">../imgcropper/demo.html</a>
<pre>
__.load(['imgcropper'], function() {
  var _ = __._;
  var oImgUploader = new __.widget.ImgUploader('container', {
    postUrl : './upload.html',
    maxImgCount : 6, // max number of images to upload
    cropConfig : {
      postUrl : './crop.html',
      onOk : function(cropObj) {
        alert(_.dump(cropObj));
      }
    }
  });
 //oImgUploader.addImages(); use add images to add image after initiate
});
</pre>
  </div>
</div>
<script src="../example.js"></script>
<script src="http://double-underscore.googlecode.com/svn/trunk/src/loader/loader.js"></script>
<script>
__.load('imguploader', function() {

  /* begin:图片裁剪上传 */
  var oImgUploader = new __.widget.ImgUploader('container', {
    postUrl : './upload.html',
    maxImgCount : 6, // max number of images to upload
    cropConfig : {
      postUrl : './crop.html',
      onOk : function(cropObj) {
        console.log(cropObj);
      }
    }
  });

  var existingPic = {
    data : 'some data',
    url : 'http://stauren.net/uploads/agirl.jpg'
  };
  oImgUploader.addImages([existingPic, existingPic, existingPic]);
  oImgUploader.addImages(existingPic);
  /* end:图片裁剪上传 */

});
</script>
</body>
</html>

